﻿using System;
using System.Data.OleDb;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            SqlConnection conn = new SqlConnection("server=.;database=PowerPlant;uid=sa;pwd=sa");
            Random rd1 = new Random();
            conn.Open();
            DateTime dt = DateTime.Now;
            for (int i = 0; i < 10000; i++)
            {
                double data1 = rd1.Next(80000000, 170000000) / 1000000.0;
                double data2 = rd1.Next(400000, 650000) / 100000.0;
                SqlCommand comm = new SqlCommand("insert into status_danji values('" + data2+ "','" + data1 + "','70','"+dt.ToString()+"')", conn);
                dt=dt.AddSeconds(12);
                Console.WriteLine(dt.ToString());
                comm.ExecuteNonQuery();
            }
            conn.Close();
            Console.WriteLine("操作成功！！");
            Console.Read();
        }
    }
}
